// Copyright (C) 2010 Johan Rende.

//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

//	Official SVN repository and contact information can be found at
//	https://code.google.com/p/lt-engine/

package jwjgl;

import org.lwjgl.opengl.GL11;

public class DrawObj {

	/**
	 * @param args
	 */
	static int bgint;
	public static float a, b;


	public static void drawSquare(float h, float w) {
		GL11.glBegin(GL11.GL_QUADS);

		GL11.glColor3f(1.0f, 1.0f, 1.0f);

		GL11.glTexCoord2f(0.0f, 0.0f);
		GL11.glVertex2d(0, 0);

		GL11.glTexCoord2f(1.0f, 0.0f);
		GL11.glVertex2d(h, 0);

		GL11.glTexCoord2f(1.0f, 1.0f);
		GL11.glVertex2d(h, w);

		GL11.glTexCoord2f(0.0f + a, 1.0f + b);
		GL11.glVertex2d(0, w);
		GL11.glEnd();
	}

	public static void drawBackground() {

		GL11.glBindTexture(GL11.GL_TEXTURE_2D, Textures.texbgint);
		GL11.glBegin(GL11.GL_QUADS);
		GL11.glColor3f(1.0f, 1.0f, 1.0f);

		GL11.glTexCoord2f(0.0f, 0.0f);
		GL11.glVertex2f(0, 600);

		GL11.glTexCoord2f(4.0f, 0.0f);
		GL11.glVertex2f(0, 0);

		GL11.glTexCoord2f(4.0f, 4.0f);
		GL11.glVertex2f(800, 0);

		GL11.glTexCoord2f(0.0f, 4.0f);
		GL11.glVertex2f(800, 600);

		GL11.glEnd();

	}

	public static void drawRect(int length) {
		GL11.glDisable(GL11.GL_TEXTURE_2D);
		GL11.glBegin(GL11.GL_QUADS);
		GL11.glColor3f(1.0f, 1.0f, 1.0f);

		// GL11.glTexCoord2f(0.0f, 0.0f);
		GL11.glVertex2d(0, 0);

		// GL11.glTexCoord2f(1.0f, 0.0f);
		GL11.glVertex2d(0, 60); // 0, height

		// GL11.glTexCoord2f(0.0f+a, 1.0f+b);
		GL11.glVertex2d(length, 60);

		// GL11.glTexCoord2f(1.0f, 1.0f);
		GL11.glVertex2d(length, 0);

		GL11.glEnd();
		GL11.glEnable(GL11.GL_TEXTURE_2D);
	}
}
